/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pa036is.validators;

import cz.muni.fi.pa036is.dto.AdmissionFormTO;
import cz.muni.fi.pa036is.entity.Admission;
import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

/**
 *
 * @author Kuba
 */
public class AdmissionValidator implements Validator {

    @Override
    public boolean supports(Class<?> type) {
        return Admission.class.equals(type);
    }

    @Override
    public void validate(Object o, Errors errors) {


        
        ValidationUtils.rejectIfEmpty(errors, "personId", "personId.empty");
        ValidationUtils.rejectIfEmpty(errors, "seasonId", "seasonId.empty");

        AdmissionFormTO admission = (AdmissionFormTO) o;
        }
    }

